home *** CD-ROM | disk | FTP | other *** search
Wrap
; ----------------------------------------------------- ; Peace and Protection (by misspai) ; ----------------------------------------------------- ; Internal identifiers (basic) ; ----------------------------------------------------- _tf2o if ($1) return On | return Off _tf2yn if ($1) return Yes | return No _tf2any if ($1) return $_p2s($2) | return $_p2s($3-) _o2tf if (($left($1,2) == On) || ($left($1,1) == Y)) return $true | return $false _s2p if ($1 == $null) return | return $replace($1-,$chr(32),) _p2s if ($1 == $null) return | return $replace($1-,,$chr(32)) _s2c if ($1 == $null) return | return $replace($1-,$chr(32),$chr(44)) _c2s if ($1 == $null) return | return $replace($1-,$chr(44),$chr(32)) _c2sd set %.c2sd $chr(160) $+ - | return $_f2s($replace($1-,$chr(44),%.c2sd)) _s2cs if ($1 == $null) return | set %.s2cs $chr(44) $+ $chr(160) | return $_f2s($replace($1-,$chr(32),%.s2cs)) _s2sd if ($1 == $null) return | set %.s2sd $chr(160) $+ - | return $_f2s($replace($1-,$chr(32),%.s2sd)) _s2f if ($1 == $null) return | return $replace($1-,$chr(32),$chr(160)) _f2s if ($1 == $null) return | return $replace($1-,$chr(160),$chr(32)) _a2x if ($1 == $null) return | return $replace($1-,&,&&) _a1x if ($1 == $null) return | return $replace($1-,&&,&) _sfext return $replace($replace($1-,.mp3,.mp│),.mp2,.mp▓) _noquote if ($1 == $null) return | return $replace($1-,",'') _noparen if ($1 == $null) return | return $replace($replace($1-,$chr(40),[),$chr(41),]) _iniprep if ($1 == $null) return | return $replace($replace($replace($replace($1-,[,$chr(40)),],$chr(41)),=,-),$chr(32),_) _writeprep if ($1 == $null) return | return $replace($replace($replace($replace($replace($1-,,$chr(141)),,$chr(142)),,$chr(143)),,$chr(144)),,$chr(157)) _readprep if ($1 == $null) return | return $replace($replace($replace($replace($replace($1-,$chr(141),),$chr(142),),$chr(143),),$chr(144),),$chr(157),) _ffprep return $replace($replace($replace($1-,$chr(32),?),-,?),_,?) _ccdef { unset %.zz.ret set %.zz.num $_numtok(15,$1-) set %.zz.cur 1 :loop set %.zz.tok $gettok($_s2p($1-),%.zz.cur,15) set %.zz.ret %.zz.ret $+ %.zz.tok if ( isin %.zz.tok) { set %.zz.ret %.zz.ret $+ | set %.zz.tok %.zz.tok $+ } if ($calc($count(%.zz.tok,) % 2) == 1) set %.zz.ret %.zz.ret $+ if ($calc($count(%.zz.tok,) % 2) == 1) set %.zz.ret %.zz.ret $+ if ($calc($count(%.zz.tok,) % 2) == 1) set %.zz.ret %.zz.ret $+ if ($_vi(.zz.cur) <= %.zz.num) goto loop return $_p2s(%.zz.ret) } _i return $calc( [ $1 ] + 1) _j return $calc( [ $1 ] - 1) _vi inc % $+ [ $1 ] | return % [ $+ [ $1 ] ] _vd dec % $+ [ $1 ] | return % [ $+ [ $1 ] ] _round if ($len($gettok($1,2,46)) <= $2) return $1 | return $round($1,$2) _p if (($1 == 0) || ($2 == 0)) return 0% | return $_round($calc($1 * 100 / $2),2) $+ % _lchop return $left($2-,$calc($len($2-) - $1)) _rchop return $right($2-,$calc($len($2-) - $1)) _lpad %.lpad = $str($2,$1) $+ $3- | return $right(%.lpad,$calc($1 + $len($3-) - $len($strip($3-)))) _rpad %.rpad = $3- $+ $str($2,$1) | return $left(%.rpad,$calc($1 + $len($3-) - $len($strip($3-)))) _ltok if ($1 == 0) return | return $gettok($3-,1- [ $+ [ $1 ] ] ,$2) _rtok if ($1 == 0) return | if ($calc($gettok($3-,0,$2) - $_j($1)) < 1) return $3- | return $gettok($3-, [ [ $calc($gettok($3-,0,$2) - $_j($1)) ] $+ ] - ,$2) _numtok if ($2 == $null) return 0 | return $gettok($2-,0,$1) _if if ($4 != $null) return $_if2($1-) | if ($1 $2 $3) return $true | return $false _if2 if (& isin $4) { if (($1 $2 $3) && ($5 $6 $7)) return $true | return $false } | if (($1 $2 $3) || ($5 $6 $7)) return $true | return $false _ifn if ($1 == $null) return null | return $1 _hpop if (($snick($active,0) == $_j($nick($active,0))) && ($nick($active,0) > 10)) return $false | return $true _exec $1- | return _nick if ((! !isin $1) || ($left($1,1) == !)) return * | return $gettok($1,1,33) _identd if ($left($1,1) == !) return $remove($gettok($1,1,64),!) | if (! !isin $1) { if ((@ !isin $1) || ($left($1,1) == @)) return * | return $remove($gettok($1,1,64),!) } | if ($right($1,1) == !) return * | set %.idd $_rchop($pos($1,!),$left($1,$_j($pos($1,@)))) | if (%.idd == $null) return * | else return %.idd _domain if ((@ !isin $1) || ($left($1,1) == @)) { if ((! isin $1) || ($1 == $null)) return * | return $remove($1,@) } | if ($right($1,1) == @) return * | return $gettok($1,2,64) _fixmask return $_nick($1) $+ ! $+ $_identd($1) $+ @ $+ $_domain($1) _not if ($1) return $false | return $true _setting if (% [ $+ [ $1. $+ [ $2 ] ] ] != $null) return % [ $+ [ $1. $+ [ $2 ] ] ] | return % [ $+ [ $1 ] ] _color return $+ $colour($1) _plural if ($2 == 1) return $1 | return $1 $+ s _plural2 if ($3 == 1) return $1 | return $2 _col2text { set %.color $remove($remove($remove($remove($1,),),),) if (%.color == $null) unset %.fore else set %.fore $calc($gettok(%.color,1,44) % 16) if (, isin %.color) set %.back $calc($gettok(%.color,2,44) % 16) else set %.back $colour(back) unset %.text if ( isin $1) set %.text bold if ( isin $1) set %.text %.text underline if ( isin $1) set %.text %.text reverse elseif (%.fore != $null) { set %.text %.text $gettok(white-black-blue-green-light red-red-purple-orange-yellow-light green-cyan-light cyan-light blue-light purple-grey-light grey,$_i(%.fore),45) if (%.back != $colour(back)) set %.text %.text on $gettok(white-black-blue-green-light red-red-purple-orange-yellow-light green-cyan-light cyan-light blue-light purple-grey-light grey,$_i(%.back),45) } if (%.text == $null) return none return %.text } _dynpop if ($1) return %pp.popup | if (3.1 isin $os) return $chr(160) | return $str($chr(160),2) _genflood { _timersinc %delay. [ $+ [ $1 ] ] $2 $3 if (%halt. [ $+ [ $1 ] ] < % [ $+ [ $2 ] ] ) set %.+halt $true if (%max. [ $+ [ $1 ] ] <= % [ $+ [ $2 ] ] ) return $true return $false } _genfloodchan { _timersinc $_setting(delay. [ $+ [ $1 ] ] ,$4) $2 [ $+ [ $4 ] ] $3 if ($_setting(max. [ $+ [ $1 ] ] ,$4) <= % [ $+ [ $2 $+ [ $4 ] ] ] ) return $true return $false } _isopen { if (($1 == -a) || ($1 == -s) || ($1 == -ai2) || ($1 == -si2)) return $true elseif ($chan($1) == $1) return $true elseif ($query($1) == $1) return $true elseif ($left($1,1) == =) { if ($chat($remove($1,=)) == $remove($1,=)) return $true | return $false } elseif ($window($1) == $1) return $true return $false } _ischan if ($left($1,1) isin +) return $true | return $false _ismask if (((@ isin $1) && (! isin $1)) || (* isin $1)) return $true | return $false _isxw { unset %.xw %.xw.msg if (%pp.net == undernet) { if (X ison $1) { if (($ial(X!cservice@undernet.org,0) == 1) || ($address(X,5) == $null)) set %.xw X } elseif (W ison $1) { if (($ial(W!cservice@undernet.org,0) == 1) || ($address(W,5) == $null)) set %.xw W } } if (($2 == V) && (%.xw == $null)) { _error These commands require %col.target $+ X or %col.target $+ W to be on the channel. | halt } if (%.xw != $null) set %.xw.msg $_xwtarg(%.xw) return %.xw } _xwtarg if ($1 == X) return X@channels.undernet.org | return W@channels2.undernet.org _getnicks { if (xw isin $3) _isxw $1 unset %.gn.find if ($2 == $null) set %.gn.num $ialchan(*,$1,0) else set %.gn.num $ialchan($2,$1,0) if (%.gn.num == 0) return $null :loop if ($2 == $null) set %.gn.find %.gn.find $_getnick2($1,$ialchan(*,$1,%.gn.num).nick,$3) else set %.gn.find %.gn.find $_getnick2($1,$ialchan($2,$1,%.gn.num).nick,$3) if ($_vd(.gn.num) > 0) goto loop return %.gn.find } _getnick2 { if (+o isin $3) if ($2 !isop $1) return if (-o isin $3) if ($2 isop $1) return if ($2 == $me) if (not isin $3) return if (xw isin $3) if ($2 == %.xw) return return $2 } _getchans { unset %.gn.find if ($chan(0) == 0) return $null set %.gn.num $chan(0) :loop set %.gn.find %.gn.find $chan(%.gn.num) if ($_vd(.gn.num) > 0) goto loop return %.gn.find } _numsend { set %.ns.num $send(0) set %.ns.count 0 :loop if (($1 == $send(%.ns.num)) && ($send(%.ns.num).status != inactive)) inc %.ns.count if ($_vd(.ns.num) > 0) goto loop return %.ns.count } _aopt if (%+disp.address) return $+ %col.addr $+ ( $+ $1 $+ $+ %col.addr $+ ) $_opt($2-) | return $_opt($2-) _opt set %-cf1 whois " $+ $1" | set %-keybop.nick $1 | set %-keybop.addr $2 | if ($3 == $null) unset %-keybop.chan | else set %-keybop.chan $3 | if ($group(#_fkeysound) == on) return | elseif (%+disp.options) return %col.option $+ (F8:Kick ShiftF8:Ban CtrlF1:Whois) | else return _keys { set %.ky.chk $_s2c($1-) set %.ky.num $_numtok(44,%.ky.chk) unset %.ky.ret :loop set %.ky.ret $_ppcfg(Keys,$gettok(%.ky.chk,%.ky.num,44)) $+ , $+ %.ky.ret if ($_vd(.ky.num > 0)) goto loop return $_lchop(1,%.ky.ret) } _ppcfg if ($2 == $null) set %.read $readini -n $_ppdir $+ config.ini settings $_iniprep($1) | else set %.read $readini -n $_ppdir $+ config.ini $1 $_iniprep($2-) | return $_readprep(%.read) _ppblk set %.read $readini -n $_ppdir $+ black.ini Blacklist $_iniprep($1-) | return $_readprep(%.read) _ppdef set %.read $readini -n $_ppdir $+ default.ini $1 $_iniprep($2-) | return $_readprep(%.read) _ppdef2 set %.read $readini -n $_ppdir $+ fancy.ini $1 $_iniprep($2-) | return $_readprep(%.read) _ppseen if ($2 == $null) set %.read $readini -n $_ppdir $+ lastseen.ini settings $_iniprep($1) | else set %.read $readini -n $_ppdir $+ lastseen.ini $1 $_iniprep($2-) | return $_readprep(%.read) _ppdesc set %.read $readini -n $_ppdir $+ sound.ini description $_iniprep($1-) | return $_readprep(%.read) _ppqhelp set %.read $readini -n $_ppdir $+ qhelp.ini quickhelp $_iniprep($1-) | return $_readprep(%.read) _mircdir if ($chr(32) isin $mircdir) return | else return $mircdir _ppdir if ($chr(32) isin $mircdir) return pp300\ | else return $mircdirpp300\ _ppsub return pp300 _favorites if ($_ppcfg(misc,favoritesbynet)) return $_ppcfg(favorites,%pp.net) | return $_ppcfg(misc,favorites) _mpdir return $_ppcfg(sound,mpdir) _mididir return $mididir $+ ; $+ $_ppcfg(sound,moremididir) _wavedir return $wavedir $+ ; $+ $_ppcfg(sound,morewavedir) _mp2exe return $_ppcfg(sound,mp2player) _mp3exe return $_ppcfg(sound,mp3player) _thedir { set %.td.ext $_mapext($remove($1,.)) if (%.td.ext isin mp2.mp3) return $_mpdir elseif (%.td.ext == mid) return $_mididir elseif (%.td.ext == wav) return $_wavedir else { set %.td.ext %.td.ext $+ Dir set %.td.ext $_ppcfg(Sound,%.td.ext) if (%.td.ext == $null) return $_ppcfg(Sound,OtherDir) return %.td.ext } } _getmsg { set %.gm.ret $_ppcfg($1,$2) if ($left(%.gm.ret,8) == !Random:) set %.gm.ret $read -n $_adddir($gettok($gettok(%.gm.ret,1,33),2-,58)) if (%.gm.ret == $null) set %.gm.ret $_ppdef($1,$2) if (&col isin %.gm.ret) { unset %.gm.col1 %.gm.col2 set %.gm.col1 $+ $gettok(01 02 03 04 05 06 07 10 12 13 14,$r(1,11),32) :redo | set %.gm.col2 $+ $gettok(01 02 03 04 05 06 07 10 12 13 14,$r(1,11),32) | if (%.gm.col1 == %.gm.col2) goto redo set %.gm.ret $replace($replace(%.gm.ret,&col1&,%.gm.col1),&col2&,%.gm.col2) } :repeat if (&count isin %.gm.ret) { %.gm.pos = $pos(%.gm.ret,&count) + 5 set %.gm.tag $gettok($_rchop(%.gm.pos,%.gm.ret),1,38) if (%.gm.tag == $null) goto done set %.gm.type counter- $+ $left(%.gm.tag,1) set %.gm.num $_rchop(1,%.gm.tag) if (%.gm.num == $null) set %.gm.num 0 set %.gm.old $_ppcfg(%.gm.type,%.gm.num) inc %.gm.old _writecfg %.gm.type %.gm.num %.gm.old set %.gm.tag &count $+ %.gm.tag $+ & set %.gm.ret $replace(%.gm.ret,%.gm.tag,%.gm.old) goto repeat } :done return $replace($replace($replace($replace(%.gm.ret,&me&,$me),&[&,%[),&]&,%]),&ver&,%pp.ver) } ; Formats a msg with <$etc$ >$etc$ (cannot overlap but can nest) Whatever is between is replaced with $etc(in between) ; <$etc,blah$ >$etc,heh$ will use blah, as initial parameters and ,heh as final parameters ; Also, !$etc$ is replaced with $etc ; is NOT $chr(127) in these aliases! BE CAREFUL _finalmsg { if ($1 == $null) return if ($ !isin $1-) return $_stripout($1-) set %.fm.ret $replace($replace($1-,$chr(32),ì),!$,Ç) if ($left(%.fm.ret,1) == Ç) set %.fm.ret ì $+ %.fm.ret set %.fm.num $_numtok(128,%.fm.ret) if (%.fm.num > 1) { set %.fm.ret2 $gettok(%.fm.ret,1,128) set %.fm.cur 2 :loop set %.fm.id $chr(36) $+ $gettok($gettok(%.fm.ret,%.fm.cur,128),1,36) set %.fm.ret2 %.fm.ret2 $+ [ [ $_p2s(%.fm.id) ] ] $+ $_rchop($len(%.fm.id),$gettok(%.fm.ret,%.fm.cur,128)) if ($_vi(.fm.cur) <= %.fm.num) goto loop set %.fm.ret %.fm.ret2 } if (<$ isin %.fm.ret) { set %.fm.ret $replace($replace(%.fm.ret,<$,Ç),>$,ü) set %.fm.ret $_dofm1(1,%.fm.ret) } return $_stripout($replace(%.fm.ret,ì,$chr(32))) } _dofmv return %. [ $+ [ $1 $+ [ $2 ] ] ] _dofms set %. [ $+ [ $1 $+ [ $2 ] ] ] $3- _dofm2 if ($2 == $null) return | return $_dofm1($_i($1),$2-) _dofm1 { if (Ç !isin $2-) return $2- _dofms $1 fm.todo $2- | _dofms $1 fm.done :do if ($left($_dofmv($1,fm.todo),1) == Ç) _dofms $1 fm.todo $_rchop(1,$_dofmv($1,fm.todo)) else { _dofms $1 fm.done $_dofmv($1,fm.done) $+ $gettok($_dofmv($1,fm.todo),1,128) | _dofms $1 fm.todo $gettok($_dofmv($1,fm.todo),2-,128) } _dofms $1 fm.id $gettok($_dofmv($1,fm.todo),1,36) | _dofms $1 fm.todo $gettok($_dofmv($1,fm.todo),2-,36) _dofms $1 fm.ask $gettok($replace($_dofmv($1,fm.todo), ü [ $+ [ $_dofmv($1,fm.id) ] ] ,Ä),1,142) _dofms $1 fm.param $replace($_dofm2($1,$_dofmv($1,fm.ask)),ì,$chr(32)) _dofms $1 fm.todo $_rchop($_i($len($_dofmv($1,fm.ask))),$_dofmv($1,fm.todo)) _dofms $1 fm.todo $gettok($_dofmv($1,fm.todo),2-,36) _dofms $1 fm.id $chr(36) $+ $_dofmv($1,fm.id) $+ $chr(40) $+ $_dofmv($1,fm.param) $+ $chr(41) return $_dofmv($1,fm.done) $+ [ [ $_dofmv($1,fm.id) ] ] $+ $_dofm2($1,$_dofmv($1,fm.todo)) } _fixmode { unset %.fm.final set %.fm.bit + set %.fm.pos 1 :loop if ($mid($1,%.fm.pos,1) isin -+) set %.fm.bit $mid($1,%.fm.pos,1) else set %.fm.final %.fm.final $+ %.fm.bit $+ $mid($1,%.fm.pos,1) if ($_vi(.fm.pos) <= $len($1)) goto loop return %.fm.final } _patch { set %.pa.num $_numtok(44,$1) set %.pa.ret $1 :loop set %.pa.ch $gettok(%.pa.ret,%.pa.num,44) if ($_not($_ischan(%.pa.ch))) { set %.pa.new $chr(35) $+ %.pa.ch set %.pa.ret $puttok(%.pa.ret,%.pa.new,%.pa.num,44) } if ($_vd(.pa.num) > 0) goto loop return %.pa.ret } _size if ($1 <= 9999) return $1 bytes | if ($calc($1 / 1024) <= 9999) return $int($calc($1 / 1024)) $+ kb | return $int($calc($1 / 1048576)) meg _size2 if ($calc($1 / 1024) <= 999) return $round($calc($1 / 1024),2) Kb | return $round($calc($1 / 1048576),2) Mb _ppmask { if ($_not($_ismask($1))) { if ($1 == $me) set %.pm.mask $me $+ ! $+ %-my.address else set %.pm.mask $address($1,5) if (%.pm.mask == $null) return $1 $+ !*@* set %.pm.mask $replace(%.pm.mask,***,,*,?,,***) } else set %.pm.mask $_fixmask($1) set %.pm.identd $_rchop($pos(%.pm.mask,!),$left(%.pm.mask,$_j($pos(%.pm.mask,@)))) set %.pm.mask $mask(%.pm.mask,$2) set %.pm.dom $gettok(%.pm.mask,2,64) if ($left(%.pm.dom,2) == *.) { set %.pm.dots $count(%.pm.dom,.) if ($right(%.pm.dom,3) == .us) set %.pm.max 4 elseif ((. isin $right(%.pm.dom,3)) || ($right(%.pm.dom,4) == .mil) || ($right(%.pm.dom,4) == .gov)) set %.pm.max 3 else set %.pm.max 2 if (%.pm.dots > %.pm.max) { set %.pm.range $calc(%.pm.dots - %.pm.max + 2) $+ - $+ $_i(%.pm.dots) set %.pm.mask $gettok(%.pm.mask,1,64) $+ @*. $+ $gettok(%.pm.dom, [ %.pm.range ] ,46) } } set %.pm.len $_j($pos(%.pm.mask,@)) :loop set %.pm.chr $mid(%.pm.mask,%.pm.len,1) if (%.pm.chr != !) { if ($asc(%.pm.chr) !isnum 33-126) set %.pm.mask $replace(%.pm.mask,%.pm.chr,?) dec %.pm.len | goto loop } if (($2 == 1) || ($2 == 3) || ($2 == 6) || ($2 == 8)) { set %.pm.newid $_rchop($pos(%.pm.mask,!),$left(%.pm.mask,$_j($pos(%.pm.mask,@)))) if (($len(%.pm.identd) <= 2) || (($len(%.pm.identd) == 3) && ($left(%.pm.identd,1) isin ^~+=-))) set %.pm.mask $gettok(%.pm.mask,1,33) $+ ! $+ %.pm.identd $+ @ $+ $gettok(%.pm.mask,2,64) elseif ($remove($remove(%.pm.newid,?),*) == $null) set %.pm.mask $gettok(%.pm.mask,1,33) $+ ! $+ %.pm.identd $+ @ $+ $gettok(%.pm.mask,2,64) else set %.pm.mask $gettok(%.pm.mask,1,33) $+ ! $+ $replace($replace(%.pm.newid,^,*),=,*) $+ @ $+ $gettok(%.pm.mask,2,64) } if (*** !isin %.pm.mask) { :short | if (** isin %.pm.mask) { set %.pm.mask $replace(%.pm.mask,**,*) | goto short } } return %.pm.mask } _renlogfile { set %.rlf.len $len($1) set %.rlf $1 :loop set %.rlf.chr $mid(%.rlf,%.rlf.len,1) if (%.rlf.chr !isin abcdefghijklmnopqrstuvwxyz_0123456789) set %.rlf $replace(%.rlf,%.rlf.chr,_) dec %.rlf.len if (%.rlf.len > 0) goto loop if ($_ischan($1,1)) set %.rlf $left($1,1) $+ $_rchop(1,%.rlf) if (3.1 isin $os) return $left(%.rlf,8) $+ .log return %.rlf $+ .log } _pwenc { unset %.pe set %.pe.len $len($1-) :loop set %.pe %.pe $+ $chr($calc(160 - $asc($mid($1-,%.pe.len,1)))) if ($_vd(.pe.len) > 0) goto loop return %.pe } ; ----------------------------------------------------- ; Possibly not belong here in ; "standard identifiers" ; ----------------------------------------------------- _antirep if ((%-ar.num !isnum) || (%-ar.num < 1)) set %-ar.num $r(1,9) | elseif (%-ar.num > 9) set %-ar.num 1 | set %.ar.ret $mid(╖.`æÆ┤╕á',%-ar.num,1) | inc %-ar.num | return %.ar.ret ; Note- Å == 0143 _pat.rand { set %.pat.num $_numtok(46,$1) set %.pat.pos 1 set %.pat.len $len($2-) set %.pat.text $replace($2-,$chr(32),Å) set %.pat Å :loop | set %.tok $gettok($1,$r(1,%.pat.num),46) | if (%.tok == $) unset %.tok | set %.pat %.pat $+ %.tok $+ $mid(%.pat.text,%.pat.pos,1) | if ($_vi(.pat.pos) <= %.pat.len) goto loop return $replace(%.pat,Å,$chr(32)) } _pattern { set %.pat.num $_numtok(46,$1) set %.pat.pos 1 | set %.pat.set 1 set %.pat.len $len($2-) set %.pat.text $replace($2-,$chr(32),Å) set %.pat Å :loop | set %.pat %.pat $+ $gettok($1,%.pat.set,46) $+ $mid(%.pat.text,%.pat.pos,1) | if ($_vi(.pat.set) > %.pat.num) set %.pat.set 1 | if ($_vi(.pat.pos) <= %.pat.len) goto loop return $replace(%.pat,Å,$chr(32)) } _kickmsg { if ($3 == $null) return $_kickwrap($1,$2,$_finalmsg($replace($replace($_getmsg(Kicks,Message),&chan&,$1),&nick&,$2))) if ($4 == $null) return $_finalmsg($replace($replace($_getmsg(Kicks,$3),&chan&,$1),&nick&,$2)) return $_finalmsg($replace($replace($replace($replace($_getmsg(Kicks,$3),&chan&,$1),&nick&,$2),&A&,$4),&B&,$5)) } _kickwrap return $_finalmsg($replace($replace($replace($_getmsg(Kicks,Wrapper),&msg&,$3-),&chan&,$1),&nick&,$2)) _tkickmsg return $_tkickwrap($1,$2,$3,$_finalmsg($replace($replace($_getmsg(Kicks,TempMessage),&chan&,$1),&nick&,$2))) _tkickwrap return $_finalmsg($replace($replace($replace($replace($_getmsg(Kicks,TempWrapper),&msg&,$4-),&chan&,$1),&nick&,$2),&dur&,$replace($replace($replace($duration($3),secs,sec),mins,min),hrs,hr))) _blackmsg { set %.bm.ret $replace($replace($replace($_getmsg($1,$2),&chan&,$_f2s($3)),&nick&,$4),&addr&,$5) if (&reason& isin %.bm.ret) set %.bm.ret $replace(%.bm.ret,&reason&,$6-) else set %.bm.ret %.bm.ret $6- return $_finalmsg(%.bm.ret) } _opmsg { set %.wo.ret $replace($replace($replace($replace($replace($_getmsg(Notice,WallOp),&chan&,$1),&ops&,$opnick($1,0)),&vocs&,$vnick($1,0)),&users&,$nick($1,0)),&ovs&,$calc($opnick($1,0) + $vnick($1,0))) if (&msg& isin %.wo.ret) set %.wo.ret $replace(%.wo.ret,&msg&,$_naction($2-)) else set %.wo.ret %.wo.ret $_naction($2-) return $_finalmsg(%.wo.ret) } _vocmsg { set %.wo.ret $replace($replace($replace($replace($replace($_getmsg(Notice,WallVoc),&chan&,$1),&ops&,$opnick($1,0)),&vocs&,$vnick($1,0)),&users&,$nick($1,0)),&ovs&,$calc($opnick($1,0) + $vnick($1,0))) if (&msg& isin %.wo.ret) set %.wo.ret $replace(%.wo.ret,&msg&,$_naction($2-)) else set %.wo.ret %.wo.ret $_naction($2-) return $_finalmsg(%.wo.ret) } _massmsg { set %.wo.ret $replace($replace($replace($_getmsg(Notice,$1),&chan&,$2),$3,$4),&users&,$nick($2,0)) if (&msg& isin %.wo.ret) set %.wo.ret $replace(%.wo.ret,&msg&,$_naction($5-)) else set %.wo.ret %.wo.ret $_naction($5-) return $_finalmsg(%.wo.ret) } _privn { set %.wo.ret $replace($_getmsg(Notice,$1),$2,$3) if (&msg& isin %.wo.ret) set %.wo.ret $replace(%.wo.ret,&msg&,$_naction($4-)) else set %.wo.ret %.wo.ret $_naction($4-) return $_finalmsg(%.wo.ret) } _naction if ($1 == /me) return * $me $2- | else return $1- ; $_nickcomp(partial,#chan) _nickcomp { if (" isin $1) return $remove($1,") if (($2 == $null) || ($chr(44) isin $1) || (* isin $1) || (! isin $1) || (@ isin $1)) return if ($1 ison $2) return $ial($1!*,1).nick if (%+nick.complete.skipifmany) if ($ialchan($1*!*@*,$2,0) > 1) return if ($ialchan($1*!*@*,$2,1).nick != $null) return $ialchan($1*!*@*,$2,1).nick set %.nc.num $nick($2,0) :loop2 if ($1* iswm $remove($remove($remove($remove($remove($remove($remove($remove($remove($remove($nick($2,%.nc.num),-),_),[),]),$chr(125)),$chr(123)),\),|),`),^)) return $nick($2,%.nc.num) if ($_vd(.nc.num) > 0) goto loop2 return } ; $_nickglob(partial) finds nickcomplete in any chan (starting in current if any) or returns partial if none found ; Returns partial if quoted _nickglob { if ($1 == $null) return if (" isin $1) return $remove($1,") if ($_not(%+nick.complete.cmd)) return $1 if (($chr(44) isin $1) || (* isin $1) || (! isin $1) || (@ isin $1)) return $1 if ($ial($1!*,0) > 0) return $ial($1!*,1).nick if ($1 isnotify) return $1 if (%+nick.complete.skipifmany) if ($ial($1*!*@*,0) > 1) return $1 if ($chan($active) == $active) { set %.ng.nick $_nickcomp($1,$active) | if (%.ng.nick != $null) return %.ng.nick } set %.ng.num $chan(0) :loop if ($chan(%.ng.num) != $active) { set %.ng.nick $_nickcomp($1,$chan(%.ng.num)) if (%.ng.nick != $null) return %.ng.nick } if ($_vd(.ng.num) > 0) goto loop set %.nm $notify(0) :golbez if ($1* iswm $notify(%.nm)) if ($notify(%.nm).ison) return $notify(%.nm) if ($_vd(.nm) > 0) goto golbez return $1 } ; Returns nick completion for a series of nicks ; $_nickseries(token,series) _nickseries { if ($2 == $null) return if ($_not(%+nick.complete.cmd)) return $remove($2-,") set %.ns.max $_numtok($1,$2-) set %.ns.num 1 unset %.ns.ret :loop set %.ns.ret $addtok(%.ns.ret,$_nickglob($gettok($2-,%.ns.num,$1)),$1) if ($_vi(.ns.num) <= %.ns.max) goto loop return %.ns.ret } ; Returns nick completion for a series of nicks for one chan ; $_nickcseries(token,#chan,series) _nickcseries { if ($3 == $null) return if ($_not(%+nick.complete.cmd)) return $remove($3-,") set %.ns.ret $3- set %.ns.max $_numtok($1,$3-) set %.ns.num 1 :loop set %.ns.get $gettok(%.ns.ret,%.ns.num,$1) set %.ns.got $_nickcomp(%.ns.get,$2) if (%.ns.got != $null) set %.ns.ret $puttok(%.ns.ret,%.ns.got,%.ns.num,$1) if ($_vi(.ns.num) <= %.ns.max) goto loop return %.ns.ret } ; strips COLORS ONLY _stripc { if ( !isin $1-) return $1- set %.sc.todo ! $+ $_s2f($1-) set %.sc.tok $_numtok(3,%.sc.todo) set %.sc.num 1 unset %.sc.ret :loop set %.sc.chk $gettok(%.sc.todo,%.sc.num,3) if ($left(%.sc.chk,2) isnum) set %.sc.chk $_rchop(2,%.sc.chk) elseif ($left(%.sc.chk,1) isnum) set %.sc.chk $_rchop(1,%.sc.chk) else goto nost if ($left(%.sc.chk,1) == ,) { set %.sc.chk2 $_rchop(1,%.sc.chk) if ($left(%.sc.chk2,2) isnum) set %.sc.chk $_rchop(2,%.sc.chk2) elseif ($left(%.sc.chk2,1) isnum) set %.sc.chk $_rchop(1,%.sc.chk2) } :nost set %.sc.ret %.sc.ret $+ %.sc.chk if ($_vi(.sc.num) <= %.sc.tok) goto loop return $_f2s($_rchop(1,%.sc.ret)) } ; strips according to %+strip.out.colors and %+strip.out.codes _stripout { if ($1 == $null) return if (%+strip.out.codes) return $strip($1-) if (%+strip.out.colors) return $_stripc($1-) return $1- } _center { if ($3 == $null) return $int($calc(( [ $window(-3).w ] - $1) / 2)) $int($calc(( [ $window(-3).h ] - $2) / 2)) else return $int($calc(( [ $window(-1).w ] - $1) / 2)) $int($calc(( [ $window(-1).h ] - $2) / 2)) } ; Returns position and size for a window with padding $1 top $2 bottom $3 left $4 right. In pixels, #% for percents, nondesktop _winpos { if (% isin $1) set %.p.1 $int($calc( [ $window(-3).h ] * $remove($1,%) / 100)) | else set %.p.1 $1 if (% isin $2) set %.p.2 $int($calc( [ $window(-3).h ] * $remove($2,%) / 100)) | else set %.p.2 $2 if (% isin $3) set %.p.3 $int($calc( [ $window(-3).w ] * $remove($3,%) / 100)) | else set %.p.3 $3 if (% isin $4) set %.p.4 $int($calc( [ $window(-3).w ] * $remove($4,%) / 100)) | else set %.p.4 $4 return %.p.3 %.p.1 $calc( [ $window(-3).w ] - %.p.3 - %.p.4) $calc( [ $window(-3).h ] - %.p.1 - %.p.2) } ; $_findwm(*a*,this is a bad routine) == bad; not find returns wildcard string minus */? _findwm { set %.wm.num $_numtok(32,$2-) :loop set %.wm.tok $gettok($2-,%.wm.num,32) if ($1 iswm %.wm.tok) return %.wm.tok if ($_vd(.wm.num) > 0) goto loop return $remove($remove($1,*),?) } _fixncol if ($1 == $null) return | return $1 ; adds $mircdir if no drive, for use with $read, also calls $_wrapfile _adddir if (: !isin $1) { if ($left($1,1) == \) return $_wrapfile( [ [ $left($mircdir,2) ] $+ [ $1- ] ] ) | return $_wrapfile($mircdir [ $+ [ $1- ] ] ) } | return $_wrapfile($1-) ; Wraps in quotes if spaces _wrapfile { if ($2 == $null) return $remove($1,") if ($shortfn($remove($1-,"))) return $ifmatch %.wftok = $gettok($remove($1-,"),0,92) %.wfran = 1- $+ $calc(%.wftok -1) return $shortfn($gettok($remove($1-,"),%.wfran,92)) $+ \ $+ $gettok($remove($1-,"),%.wftok,92) } ; $remove for a single char from a single word, case sensitive _caserem { set %.clen 1 unset %.cret :loop if ($mid($1,%.clen,1) !== $2) set %.cret %.cret $+ $mid($1,%.clen,1) if (%.clen < $len($1)) { inc %.clen | goto loop } return %.cret } ; Scales tabs _tabscale { set %.tret $_s2c($1-) set %.tokn $_numtok(44,%.tret) :loop set %.tret $puttok(%.tret,$int($calc($gettok(%.tret,%.tokn,44) * %font.fixtab / 18)),%.tokn,44) if ($_vd(.tokn) > 0) goto loop return -t $+ %.tret } ; _BLsave { if ($exists($1-)) .remove $1- set %.sav.max $line(@Banlist,0) set %.sav.num 5 :loop if (- !isin $gettok($line(@Banlist,%.sav.num),1,9)) write $_wrapfile($1-) $gettok($line(@Banlist,%.sav.num),2,9) if ($_vi(.sav.num) <= %.sav.max) goto loop _recfile2 $1- titlebar @Banlist $window(@Banlist).titlebar - Saved to $1- } _BLimport { set %.sav.num 1 :loop set %.sav.ban $read -l [ $+ [ %.sav.num ] ] $_wrapfile($1-) if (%.sav.ban != $null) { if ($_ismask(%.sav.ban)) _BLmodban + $gettok(%.sav.ban,1,32) -a inc %.sav.num goto loop } } _chksends { if ($send(0) == %lastnum.send) return elseif ($send(0) < %lastnum.send) { set %lastnum.send $send(0) | return } else { :loop inc %lastnum.send set %.dt.file $send(%lastnum.send).path $+ $send(%lastnum.send).file _recfile Sends %.dt.file | _recfile Files %.dt.file if (%+dccincomp.enable) _recinc s $send(%lastnum.send) %.dt.file if ($send(0) > %lastnum.send) goto loop } } _nomrej set %-mirc.rejoins $remtok(%-mirc.rejoins,$2,32) _dolonemode { if (%alonetopic. [ $+ [ $1 ] ] != $null) .raw topic $1 : $+ %alonetopic. [ $+ [ $1 ] ] elseif (%onoptopic. [ $+ [ $1 ] ] != $null) .raw topic $1 : $+ %onoptopic. [ $+ [ $1 ] ] elseif (%stricttopic. [ $+ [ $1 ] ] != $null) .raw topic $1 : $+ %stricttopic. [ $+ [ $1 ] ] set %.mode1 $_setting(strictmode,$1) set %.mode2 $_setting(onopmode,$1) set %.mode3 $_setting(alonemode,$1) set %.mode $gettok(%.mode1,1,32) $+ $gettok(%.mode2,1,32) $+ $gettok(%.mode3,1,32) $gettok(%.mode1,2-,32) $gettok(%.mode2,2-,32) $gettok(%.mode3,2-,32) if ($remove($remove(%.mode,+),-) != $null) { .raw mode $1 %.mode if (k isin %.mode) .timer923 1 8 _chkkey $1 } }